<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style/admin.css" />
<link rel="stylesheet" type="text/css" href="style/global.css" />
<title>决策管理</title>
</head>
<?php
	 include 'FusionCharts.php';
	 function getColor(){
	 	for($i=0;$i<6;$i++){
	 		$color = dechex(rand(0,15));
	 		$ret .= $color;
	 	}
	 	return $ret;
	 }
?>
<body>
<div id="wrap">
<div id="public_head"></div>
<div class="qf_box">
<div class="bh">问卷统计数据</div>
<div class="bc">
<div class="fleft">
<table class="qf_table" width="90%" border="0" cellpadding="0" cellspacing="1">
	<tr>
		<td width="30%">问卷名称</th>
		<td width="100">答题次数</td>
		<td>查看</td>
	</tr>
	<?php 
		if(is_array($allanswer) && count($allanswer)>0){
			foreach ($allanswer as $v){
	?>
	<tr>
		<td><a class='show_quesnr' href="/index.php?c=quesnr&a=showquest&look=1&id=<?php echo $v['QID']?>"><?php echo $quesnrs[$v['QID']]?></a></td>
		<td><?php echo $v['NUM']?></td>
		<td><a href="/index.php?c=stats&a=lookinfo&id=<?php echo $v['QID']?>" class="lookinfo">详情</a></td>
	</tr>
<?php 
			}
		}
?>
</table>
</div>
<div class="fright">
<?php
		//Create an XML data document in a string variable
		$strXML  = "";
		$strXML .= "<graph caption='问卷统计' xAxisName='问卷' yAxisName='次数' decimalPrecision='0' formatNumberScale='0'>";
		if(is_array($allanswer) && count($allanswer)>0){
			foreach ($allanswer as $v){
				$strXML .= "<set name='".$quesnrs[$v['QID']]."' value='".$v['NUM']."' color='".getColor()."' />";
			}
		}
		$strXML .= "</graph>";

//Create the chart - Column 3D Chart with data from strXML variable using dataXML method
echo renderChartHTML("/images/FCF_Pie2D.swf", "", $strXML, "myNext", 400, 300);
?>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</body>
</html>
<script src="/js/xheditor/jquery/jquery-1.4.4.min.js" type="text/javascript"></script>
<script src="/js/boot.js" type="text/javascript"></script>
<script src="/js/tip.js" type="text/javascript"></script>
<script src="/js/add_public_head.js" type="text/javascript"></script>
<script>
$('.show_quesnr').click(function(){
	var url = $(this).attr('href')
	window.open(url)
	return false;
})
$('.lookinfo').click(function(){
	var url=$(this).attr('href');
	window.open(url,'newwindow','width=800,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=no,location=no, status=no')
	return false;
})
</script>